// 括号是否有效

function isVlidate(str) {
    let map = { "{": "}", "[": "]", "(": ")" };
    let arr = [];
    for (let i = 0; i < str.length; i++) {
        if (map[str[i]]) {
            arr.push(map[str[i]])
        } else {
            if (str[i] == map[arr[length - 1]]) {
                arr.pop()
            }
        }
    }
    return arr.length === 0
}